package com.atguigu.config;

import com.atguigu.bean.Car;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
 * 生命周期配置
 * @author : zjj
 * @date : 2021/9/24 9:21
 */

@Configuration
public class MainLifeCycleConfiguration {

    /**
     * 根据注解的属性值 ，来指定bean的初始化方法和销毁方法
     * @return      car
     */
    @Bean(destroyMethod = "destroy",initMethod = "init")
    public Car car(){
        return new Car();
    }
}
